{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=4 fonc=\"仿宋\" color=blue>一、环境准备</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T12:07:49.636316Z",
     "start_time": "2021-07-16T12:07:48.200234Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 1.41 s\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "import os\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')\n",
    "import matplotlib\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.preprocessing import OneHotEncoder\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.metrics import f1_score, classification_report\n",
    "from xgboost import XGBClassifier\n",
    "from imblearn.over_sampling import SMOTE\n",
    "from sklearn.model_selection import GridSearchCV, KFold\n",
    "from toad.detector import detect\n",
    "\n",
    "np.set_printoptions(suppress=True)\n",
    "pd.set_option('display.width', 180)\n",
    "pd.set_option('display.max_rows', None)\n",
    "pd.set_option('display.max_columns', 100)\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=4 fonc='仿宋' color=blue>二、导入数据</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T12:07:52.175461Z",
     "start_time": "2021-07-16T12:07:51.330413Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 838 ms\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "path = os.path.dirname(os.getcwd()) + \"/data/\"\n",
    "\n",
    "def load_cehicle_data(file, encoding='utf-8'):\n",
    "    return pd.read_csv(file, encoding=encoding)\n",
    "\n",
    "for file in os.listdir(path):\n",
    "    if 'train' in file:\n",
    "        train = load_cehicle_data(path + file)\n",
    "    elif 'test' in file:\n",
    "        test = load_cehicle_data(path + file)\n",
    "    else:\n",
    "        pass"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=4 fonc=\"仿宋\" color=blue>三、查看数据</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T11:23:06.316839Z",
     "start_time": "2021-07-16T11:23:06.272836Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 0 ns\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>customer_id</th>\n",
       "      <th>main_account_loan_no</th>\n",
       "      <th>main_account_active_loan_no</th>\n",
       "      <th>main_account_overdue_no</th>\n",
       "      <th>main_account_outstanding_loan</th>\n",
       "      <th>main_account_sanction_loan</th>\n",
       "      <th>main_account_disbursed_loan</th>\n",
       "      <th>sub_account_loan_no</th>\n",
       "      <th>sub_account_active_loan_no</th>\n",
       "      <th>sub_account_overdue_no</th>\n",
       "      <th>sub_account_outstanding_loan</th>\n",
       "      <th>sub_account_sanction_loan</th>\n",
       "      <th>sub_account_disbursed_loan</th>\n",
       "      <th>disbursed_amount</th>\n",
       "      <th>asset_cost</th>\n",
       "      <th>branch_id</th>\n",
       "      <th>supplier_id</th>\n",
       "      <th>manufacturer_id</th>\n",
       "      <th>area_id</th>\n",
       "      <th>employee_code_id</th>\n",
       "      <th>mobileno_flag</th>\n",
       "      <th>idcard_flag</th>\n",
       "      <th>Driving_flag</th>\n",
       "      <th>passport_flag</th>\n",
       "      <th>credit_score</th>\n",
       "      <th>main_account_monthly_payment</th>\n",
       "      <th>sub_account_monthly_payment</th>\n",
       "      <th>last_six_month_new_loan_no</th>\n",
       "      <th>last_six_month_defaulted_no</th>\n",
       "      <th>average_age</th>\n",
       "      <th>credit_history</th>\n",
       "      <th>enquirie_no</th>\n",
       "      <th>loan_to_asset_ratio</th>\n",
       "      <th>total_account_loan_no</th>\n",
       "      <th>sub_account_inactive_loan_no</th>\n",
       "      <th>total_inactive_loan_no</th>\n",
       "      <th>main_account_inactive_loan_no</th>\n",
       "      <th>total_overdue_no</th>\n",
       "      <th>total_outstanding_loan</th>\n",
       "      <th>total_sanction_loan</th>\n",
       "      <th>total_disbursed_loan</th>\n",
       "      <th>total_monthly_payment</th>\n",
       "      <th>outstanding_disburse_ratio</th>\n",
       "      <th>main_account_tenure</th>\n",
       "      <th>sub_account_tenure</th>\n",
       "      <th>disburse_to_sactioned_ratio</th>\n",
       "      <th>active_to_inactive_act_ratio</th>\n",
       "      <th>year_of_birth</th>\n",
       "      <th>disbursed_date</th>\n",
       "      <th>Credit_level</th>\n",
       "      <th>employment_type</th>\n",
       "      <th>age</th>\n",
       "      <th>loan_default</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>105691</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>384989</td>\n",
       "      <td>666207</td>\n",
       "      <td>666207</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>31324</td>\n",
       "      <td>68657</td>\n",
       "      <td>0</td>\n",
       "      <td>535</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>645</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>300</td>\n",
       "      <td>8169</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>86</td>\n",
       "      <td>18</td>\n",
       "      <td>0</td>\n",
       "      <td>0.456239</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>384989</td>\n",
       "      <td>666207</td>\n",
       "      <td>666207</td>\n",
       "      <td>8169</td>\n",
       "      <td>1.73</td>\n",
       "      <td>81</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>2.50</td>\n",
       "      <td>1968</td>\n",
       "      <td>2019</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>51</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>24938</td>\n",
       "      <td>7</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>268670</td>\n",
       "      <td>387994</td>\n",
       "      <td>387994</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>53078</td>\n",
       "      <td>65565</td>\n",
       "      <td>1</td>\n",
       "      <td>767</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>959</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>691</td>\n",
       "      <td>2400</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>13</td>\n",
       "      <td>28</td>\n",
       "      <td>0</td>\n",
       "      <td>0.809548</td>\n",
       "      <td>7</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>268670</td>\n",
       "      <td>387994</td>\n",
       "      <td>387994</td>\n",
       "      <td>2400</td>\n",
       "      <td>1.44</td>\n",
       "      <td>161</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.33</td>\n",
       "      <td>1992</td>\n",
       "      <td>2019</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>27</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>104389</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>3519013</td>\n",
       "      <td>3613854</td>\n",
       "      <td>3576048</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>53639</td>\n",
       "      <td>67501</td>\n",
       "      <td>56</td>\n",
       "      <td>138</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>2766</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>832</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>27</td>\n",
       "      <td>55</td>\n",
       "      <td>0</td>\n",
       "      <td>0.794640</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3519013</td>\n",
       "      <td>3613854</td>\n",
       "      <td>3576048</td>\n",
       "      <td>0</td>\n",
       "      <td>1.02</td>\n",
       "      <td>3576048</td>\n",
       "      <td>0</td>\n",
       "      <td>0.99</td>\n",
       "      <td>3.00</td>\n",
       "      <td>1991</td>\n",
       "      <td>2019</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>28</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>54688</td>\n",
       "      <td>43</td>\n",
       "      <td>13</td>\n",
       "      <td>6</td>\n",
       "      <td>1867106</td>\n",
       "      <td>2484678</td>\n",
       "      <td>2486856</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>62513</td>\n",
       "      <td>75661</td>\n",
       "      <td>50</td>\n",
       "      <td>211</td>\n",
       "      <td>2</td>\n",
       "      <td>16</td>\n",
       "      <td>1415</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>464</td>\n",
       "      <td>4320912</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>4</td>\n",
       "      <td>19</td>\n",
       "      <td>91</td>\n",
       "      <td>0</td>\n",
       "      <td>0.826225</td>\n",
       "      <td>43</td>\n",
       "      <td>30</td>\n",
       "      <td>0</td>\n",
       "      <td>30</td>\n",
       "      <td>6</td>\n",
       "      <td>1867106</td>\n",
       "      <td>2484678</td>\n",
       "      <td>2486856</td>\n",
       "      <td>4320912</td>\n",
       "      <td>1.33</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.42</td>\n",
       "      <td>1964</td>\n",
       "      <td>2019</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>63894</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>34439</td>\n",
       "      <td>62616</td>\n",
       "      <td>6</td>\n",
       "      <td>216</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>1186</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.550003</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1995</td>\n",
       "      <td>2019</td>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   customer_id  main_account_loan_no  main_account_active_loan_no  main_account_overdue_no  main_account_outstanding_loan  main_account_sanction_loan  \\\n",
       "0       105691                     4                            3                        0                         384989                      666207   \n",
       "1        24938                     7                            2                        0                         268670                      387994   \n",
       "2       104389                     5                            4                        1                        3519013                     3613854   \n",
       "3        54688                    43                           13                        6                        1867106                     2484678   \n",
       "4        63894                     0                            0                        0                              0                           0   \n",
       "\n",
       "   main_account_disbursed_loan  sub_account_loan_no  sub_account_active_loan_no  sub_account_overdue_no  sub_account_outstanding_loan  sub_account_sanction_loan  \\\n",
       "0                       666207                    0                           0                       0                             0                          0   \n",
       "1                       387994                    0                           0                       0                             0                          0   \n",
       "2                      3576048                    0                           0                       0                             0                          0   \n",
       "3                      2486856                    0                           0                       0                             0                          0   \n",
       "4                            0                    0                           0                       0                             0                          0   \n",
       "\n",
       "   sub_account_disbursed_loan  disbursed_amount  asset_cost  branch_id  supplier_id  manufacturer_id  area_id  employee_code_id  mobileno_flag  idcard_flag  Driving_flag  \\\n",
       "0                           0             31324       68657          0          535                2        0               645              1            1             0   \n",
       "1                           0             53078       65565          1          767                1        1               959              1            1             0   \n",
       "2                           0             53639       67501         56          138                2        3              2766              1            1             0   \n",
       "3                           0             62513       75661         50          211                2       16              1415              1            1             0   \n",
       "4                           0             34439       62616          6          216                2        4              1186              1            1             0   \n",
       "\n",
       "   passport_flag  credit_score  main_account_monthly_payment  sub_account_monthly_payment  last_six_month_new_loan_no  last_six_month_defaulted_no  average_age  credit_history  \\\n",
       "0              0           300                          8169                            0                           0                            0           86              18   \n",
       "1              0           691                          2400                            0                           1                            0           13              28   \n",
       "2              0           832                             0                            0                           1                            0           27              55   \n",
       "3              0           464                       4320912                            0                           7                            4           19              91   \n",
       "4              0             0                             0                            0                           0                            0            0               0   \n",
       "\n",
       "   enquirie_no  loan_to_asset_ratio  total_account_loan_no  sub_account_inactive_loan_no  total_inactive_loan_no  main_account_inactive_loan_no  total_overdue_no  \\\n",
       "0            0             0.456239                      4                             1                       0                              1                 0   \n",
       "1            0             0.809548                      7                             5                       0                              5                 0   \n",
       "2            0             0.794640                      5                             1                       0                              1                 1   \n",
       "3            0             0.826225                     43                            30                       0                             30                 6   \n",
       "4            1             0.550003                      0                             0                       0                              0                 0   \n",
       "\n",
       "   total_outstanding_loan  total_sanction_loan  total_disbursed_loan  total_monthly_payment  outstanding_disburse_ratio  main_account_tenure  sub_account_tenure  \\\n",
       "0                  384989               666207                666207                   8169                        1.73                   81                   0   \n",
       "1                  268670               387994                387994                   2400                        1.44                  161                   0   \n",
       "2                 3519013              3613854               3576048                      0                        1.02              3576048                   0   \n",
       "3                 1867106              2484678               2486856                4320912                        1.33                    0                   0   \n",
       "4                       0                    0                     0                      0                        1.00                    0                   0   \n",
       "\n",
       "   disburse_to_sactioned_ratio  active_to_inactive_act_ratio  year_of_birth  disbursed_date  Credit_level  employment_type  age  loan_default  \n",
       "0                         1.00                          2.50           1968            2019             1                0   51             0  \n",
       "1                         1.00                          1.33           1992            2019             9                0   27             0  \n",
       "2                         0.99                          3.00           1991            2019            13                1   28             0  \n",
       "3                         1.00                          1.42           1964            2019             3                1   55             0  \n",
       "4                         1.00                          1.00           1995            2019            -1                0   24             0  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%%time\n",
    "train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T11:23:09.218005Z",
     "start_time": "2021-07-16T11:23:09.176002Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 0 ns\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>customer_id</th>\n",
       "      <th>main_account_loan_no</th>\n",
       "      <th>main_account_active_loan_no</th>\n",
       "      <th>main_account_overdue_no</th>\n",
       "      <th>main_account_outstanding_loan</th>\n",
       "      <th>main_account_sanction_loan</th>\n",
       "      <th>main_account_disbursed_loan</th>\n",
       "      <th>sub_account_loan_no</th>\n",
       "      <th>sub_account_active_loan_no</th>\n",
       "      <th>sub_account_overdue_no</th>\n",
       "      <th>sub_account_outstanding_loan</th>\n",
       "      <th>sub_account_sanction_loan</th>\n",
       "      <th>sub_account_disbursed_loan</th>\n",
       "      <th>disbursed_amount</th>\n",
       "      <th>asset_cost</th>\n",
       "      <th>branch_id</th>\n",
       "      <th>supplier_id</th>\n",
       "      <th>manufacturer_id</th>\n",
       "      <th>area_id</th>\n",
       "      <th>employee_code_id</th>\n",
       "      <th>mobileno_flag</th>\n",
       "      <th>idcard_flag</th>\n",
       "      <th>Driving_flag</th>\n",
       "      <th>passport_flag</th>\n",
       "      <th>credit_score</th>\n",
       "      <th>main_account_monthly_payment</th>\n",
       "      <th>sub_account_monthly_payment</th>\n",
       "      <th>last_six_month_new_loan_no</th>\n",
       "      <th>last_six_month_defaulted_no</th>\n",
       "      <th>average_age</th>\n",
       "      <th>credit_history</th>\n",
       "      <th>enquirie_no</th>\n",
       "      <th>loan_to_asset_ratio</th>\n",
       "      <th>total_account_loan_no</th>\n",
       "      <th>sub_account_inactive_loan_no</th>\n",
       "      <th>total_inactive_loan_no</th>\n",
       "      <th>main_account_inactive_loan_no</th>\n",
       "      <th>total_overdue_no</th>\n",
       "      <th>total_outstanding_loan</th>\n",
       "      <th>total_sanction_loan</th>\n",
       "      <th>total_disbursed_loan</th>\n",
       "      <th>total_monthly_payment</th>\n",
       "      <th>outstanding_disburse_ratio</th>\n",
       "      <th>main_account_tenure</th>\n",
       "      <th>sub_account_tenure</th>\n",
       "      <th>disburse_to_sactioned_ratio</th>\n",
       "      <th>active_to_inactive_act_ratio</th>\n",
       "      <th>year_of_birth</th>\n",
       "      <th>disbursed_date</th>\n",
       "      <th>Credit_level</th>\n",
       "      <th>employment_type</th>\n",
       "      <th>age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>14342</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>75804</td>\n",
       "      <td>57000</td>\n",
       "      <td>75804</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>48349</td>\n",
       "      <td>65217</td>\n",
       "      <td>26</td>\n",
       "      <td>602</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>735</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>300</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>109</td>\n",
       "      <td>1</td>\n",
       "      <td>0.741356</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>75804</td>\n",
       "      <td>57000</td>\n",
       "      <td>75804</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>75804</td>\n",
       "      <td>0</td>\n",
       "      <td>1.33</td>\n",
       "      <td>1.25</td>\n",
       "      <td>1976</td>\n",
       "      <td>2019</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>94753</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>50503</td>\n",
       "      <td>66416</td>\n",
       "      <td>16</td>\n",
       "      <td>123</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>131</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.760404</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1970</td>\n",
       "      <td>2019</td>\n",
       "      <td>-1</td>\n",
       "      <td>1</td>\n",
       "      <td>49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>140283</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>68623</td>\n",
       "      <td>100800</td>\n",
       "      <td>14</td>\n",
       "      <td>395</td>\n",
       "      <td>2</td>\n",
       "      <td>8</td>\n",
       "      <td>450</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.680784</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1997</td>\n",
       "      <td>2019</td>\n",
       "      <td>-1</td>\n",
       "      <td>1</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>134742</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>42100</td>\n",
       "      <td>90186</td>\n",
       "      <td>90186</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>56513</td>\n",
       "      <td>69300</td>\n",
       "      <td>6</td>\n",
       "      <td>506</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>2108</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>738</td>\n",
       "      <td>8540</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>19</td>\n",
       "      <td>0</td>\n",
       "      <td>0.815483</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>42100</td>\n",
       "      <td>90186</td>\n",
       "      <td>90186</td>\n",
       "      <td>8540</td>\n",
       "      <td>2.14</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>2.33</td>\n",
       "      <td>1977</td>\n",
       "      <td>2019</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4749</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>40104</td>\n",
       "      <td>68800</td>\n",
       "      <td>4</td>\n",
       "      <td>789</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>986</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.582907</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1984</td>\n",
       "      <td>2019</td>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   customer_id  main_account_loan_no  main_account_active_loan_no  main_account_overdue_no  main_account_outstanding_loan  main_account_sanction_loan  \\\n",
       "0        14342                     4                            1                        3                          75804                       57000   \n",
       "1        94753                     0                            0                        0                              0                           0   \n",
       "2       140283                     0                            0                        0                              0                           0   \n",
       "3       134742                     6                            4                        0                          42100                       90186   \n",
       "4         4749                     0                            0                        0                              0                           0   \n",
       "\n",
       "   main_account_disbursed_loan  sub_account_loan_no  sub_account_active_loan_no  sub_account_overdue_no  sub_account_outstanding_loan  sub_account_sanction_loan  \\\n",
       "0                        75804                    0                           0                       0                             0                          0   \n",
       "1                            0                    0                           0                       0                             0                          0   \n",
       "2                            0                    0                           0                       0                             0                          0   \n",
       "3                        90186                    0                           0                       0                             0                          0   \n",
       "4                            0                    0                           0                       0                             0                          0   \n",
       "\n",
       "   sub_account_disbursed_loan  disbursed_amount  asset_cost  branch_id  supplier_id  manufacturer_id  area_id  employee_code_id  mobileno_flag  idcard_flag  Driving_flag  \\\n",
       "0                           0             48349       65217         26          602                2        5               735              1            1             0   \n",
       "1                           0             50503       66416         16          123                2        2               131              1            1             0   \n",
       "2                           0             68623      100800         14          395                2        8               450              1            1             0   \n",
       "3                           0             56513       69300          6          506                2        4              2108              1            1             0   \n",
       "4                           0             40104       68800          4          789                5        5               986              1            1             0   \n",
       "\n",
       "   passport_flag  credit_score  main_account_monthly_payment  sub_account_monthly_payment  last_six_month_new_loan_no  last_six_month_defaulted_no  average_age  credit_history  \\\n",
       "0              0           300                             0                            0                           0                            0           40             109   \n",
       "1              0             0                             0                            0                           0                            0            0               0   \n",
       "2              0             0                             0                            0                           0                            0            0               0   \n",
       "3              0           738                          8540                            0                           1                            0            1              19   \n",
       "4              0             0                             0                            0                           0                            0            0               0   \n",
       "\n",
       "   enquirie_no  loan_to_asset_ratio  total_account_loan_no  sub_account_inactive_loan_no  total_inactive_loan_no  main_account_inactive_loan_no  total_overdue_no  \\\n",
       "0            1             0.741356                      4                             3                       0                              3                 3   \n",
       "1            0             0.760404                      0                             0                       0                              0                 0   \n",
       "2            1             0.680784                      0                             0                       0                              0                 0   \n",
       "3            0             0.815483                      6                             2                       0                              2                 0   \n",
       "4            0             0.582907                      0                             0                       0                              0                 0   \n",
       "\n",
       "   total_outstanding_loan  total_sanction_loan  total_disbursed_loan  total_monthly_payment  outstanding_disburse_ratio  main_account_tenure  sub_account_tenure  \\\n",
       "0                   75804                57000                 75804                      0                        1.00                75804                   0   \n",
       "1                       0                    0                     0                      0                        1.00                    0                   0   \n",
       "2                       0                    0                     0                      0                        1.00                    0                   0   \n",
       "3                   42100                90186                 90186                   8540                        2.14                   10                   0   \n",
       "4                       0                    0                     0                      0                        1.00                    0                   0   \n",
       "\n",
       "   disburse_to_sactioned_ratio  active_to_inactive_act_ratio  year_of_birth  disbursed_date  Credit_level  employment_type  age  \n",
       "0                         1.33                          1.25           1976            2019             1                0   43  \n",
       "1                         1.00                          1.00           1970            2019            -1                1   49  \n",
       "2                         1.00                          1.00           1997            2019            -1                1   22  \n",
       "3                         1.00                          2.33           1977            2019            11                0   42  \n",
       "4                         1.00                          1.00           1984            2019            -1                0   35  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%%time\n",
    "test.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T11:23:12.900215Z",
     "start_time": "2021-07-16T11:23:12.195175Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>type</th>\n",
       "      <th>size</th>\n",
       "      <th>missing</th>\n",
       "      <th>unique</th>\n",
       "      <th>mean_or_top1</th>\n",
       "      <th>std_or_top2</th>\n",
       "      <th>min_or_top3</th>\n",
       "      <th>1%_or_top4</th>\n",
       "      <th>10%_or_top5</th>\n",
       "      <th>50%_or_bottom5</th>\n",
       "      <th>75%_or_bottom4</th>\n",
       "      <th>90%_or_bottom3</th>\n",
       "      <th>99%_or_bottom2</th>\n",
       "      <th>max_or_bottom1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>customer_id</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>150000</td>\n",
       "      <td>9.994437e+04</td>\n",
       "      <td>5.762911e+04</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>1985.990000</td>\n",
       "      <td>20055.900000</td>\n",
       "      <td>99887.500000</td>\n",
       "      <td>149916.500000</td>\n",
       "      <td>179763.10000</td>\n",
       "      <td>1.976900e+05</td>\n",
       "      <td>1.997160e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>main_account_loan_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>104</td>\n",
       "      <td>2.447133e+00</td>\n",
       "      <td>5.197172e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>7.00000</td>\n",
       "      <td>2.300000e+01</td>\n",
       "      <td>3.540000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>main_account_active_loan_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>35</td>\n",
       "      <td>1.045500e+00</td>\n",
       "      <td>1.952708e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.00000</td>\n",
       "      <td>9.000000e+00</td>\n",
       "      <td>1.440000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>main_account_overdue_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>19</td>\n",
       "      <td>1.534267e-01</td>\n",
       "      <td>5.424963e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.00000</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>2.300000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>main_account_outstanding_loan</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>48609</td>\n",
       "      <td>1.670825e+05</td>\n",
       "      <td>9.808619e+05</td>\n",
       "      <td>-6.678296e+06</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>35459.000000</td>\n",
       "      <td>306508.00000</td>\n",
       "      <td>2.901551e+06</td>\n",
       "      <td>9.652492e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>main_account_sanction_loan</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>30564</td>\n",
       "      <td>2.225586e+05</td>\n",
       "      <td>2.840313e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>63600.000000</td>\n",
       "      <td>450000.00000</td>\n",
       "      <td>3.458866e+06</td>\n",
       "      <td>1.000000e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>main_account_disbursed_loan</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>32862</td>\n",
       "      <td>2.221730e+05</td>\n",
       "      <td>2.844075e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>61508.500000</td>\n",
       "      <td>450000.00000</td>\n",
       "      <td>3.446830e+06</td>\n",
       "      <td>1.000000e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sub_account_loan_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>36</td>\n",
       "      <td>6.013333e-02</td>\n",
       "      <td>6.529115e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>5.200000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sub_account_active_loan_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>21</td>\n",
       "      <td>2.796667e-02</td>\n",
       "      <td>3.251849e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>3.600000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sub_account_overdue_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>8</td>\n",
       "      <td>7.293333e-03</td>\n",
       "      <td>1.112365e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>7.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sub_account_outstanding_loan</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>2108</td>\n",
       "      <td>5.416077e+03</td>\n",
       "      <td>1.617336e+05</td>\n",
       "      <td>-5.746470e+05</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>2.048519e+04</td>\n",
       "      <td>3.603285e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sub_account_sanction_loan</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>1519</td>\n",
       "      <td>7.385876e+03</td>\n",
       "      <td>1.742796e+05</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>5.000000e+04</td>\n",
       "      <td>2.688820e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sub_account_disbursed_loan</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>1725</td>\n",
       "      <td>7.268286e+03</td>\n",
       "      <td>1.735824e+05</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>4.800000e+04</td>\n",
       "      <td>2.688820e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>disbursed_amount</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>19235</td>\n",
       "      <td>5.423848e+04</td>\n",
       "      <td>1.283546e+04</td>\n",
       "      <td>1.332000e+04</td>\n",
       "      <td>26529.000000</td>\n",
       "      <td>39554.000000</td>\n",
       "      <td>53703.000000</td>\n",
       "      <td>60220.000000</td>\n",
       "      <td>68869.00000</td>\n",
       "      <td>9.529000e+04</td>\n",
       "      <td>9.905720e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>asset_cost</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>38902</td>\n",
       "      <td>7.580399e+04</td>\n",
       "      <td>1.879745e+04</td>\n",
       "      <td>3.700000e+04</td>\n",
       "      <td>47109.910000</td>\n",
       "      <td>61328.000000</td>\n",
       "      <td>70925.000000</td>\n",
       "      <td>79130.000000</td>\n",
       "      <td>99077.20000</td>\n",
       "      <td>1.553340e+05</td>\n",
       "      <td>1.628992e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>branch_id</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>82</td>\n",
       "      <td>2.928638e+01</td>\n",
       "      <td>1.933546e+01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>6.000000</td>\n",
       "      <td>28.000000</td>\n",
       "      <td>45.000000</td>\n",
       "      <td>55.00000</td>\n",
       "      <td>7.500000e+01</td>\n",
       "      <td>8.100000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>supplier_id</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>2888</td>\n",
       "      <td>7.249790e+02</td>\n",
       "      <td>6.257256e+02</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>9.000000</td>\n",
       "      <td>75.000000</td>\n",
       "      <td>544.000000</td>\n",
       "      <td>1091.000000</td>\n",
       "      <td>1669.00000</td>\n",
       "      <td>2.483010e+03</td>\n",
       "      <td>2.933000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>manufacturer_id</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>10</td>\n",
       "      <td>2.260600e+00</td>\n",
       "      <td>1.403826e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>5.00000</td>\n",
       "      <td>6.000000e+00</td>\n",
       "      <td>9.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>area_id</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>22</td>\n",
       "      <td>5.614153e+00</td>\n",
       "      <td>5.513141e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>9.000000</td>\n",
       "      <td>16.00000</td>\n",
       "      <td>1.800000e+01</td>\n",
       "      <td>2.100000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>employee_code_id</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>3241</td>\n",
       "      <td>1.207023e+03</td>\n",
       "      <td>8.124421e+02</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>197.000000</td>\n",
       "      <td>1107.000000</td>\n",
       "      <td>1833.000000</td>\n",
       "      <td>2405.00000</td>\n",
       "      <td>2.980000e+03</td>\n",
       "      <td>3.255000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mobileno_flag</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>1</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.00000</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idcard_flag</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>1</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.00000</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Driving_flag</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>2</td>\n",
       "      <td>2.301333e-02</td>\n",
       "      <td>1.499462e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>passport_flag</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>2</td>\n",
       "      <td>2.153333e-03</td>\n",
       "      <td>4.635419e-02</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>credit_score</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>570</td>\n",
       "      <td>2.912287e+02</td>\n",
       "      <td>3.392824e+02</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>14.000000</td>\n",
       "      <td>680.000000</td>\n",
       "      <td>762.00000</td>\n",
       "      <td>8.360000e+02</td>\n",
       "      <td>8.900000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>main_account_monthly_payment</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>21499</td>\n",
       "      <td>1.295898e+04</td>\n",
       "      <td>1.508468e+05</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1989.000000</td>\n",
       "      <td>11458.10000</td>\n",
       "      <td>2.515448e+05</td>\n",
       "      <td>2.076655e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sub_account_monthly_payment</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>1304</td>\n",
       "      <td>2.938682e+02</td>\n",
       "      <td>1.304782e+04</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>3.246710e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>last_six_month_new_loan_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>24</td>\n",
       "      <td>3.849000e-01</td>\n",
       "      <td>9.628767e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.00000</td>\n",
       "      <td>4.000000e+00</td>\n",
       "      <td>3.500000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>last_six_month_defaulted_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>14</td>\n",
       "      <td>9.568667e-02</td>\n",
       "      <td>3.823590e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>2.000000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>average_age</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>100</td>\n",
       "      <td>8.027107e+00</td>\n",
       "      <td>1.383039e+01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>13.000000</td>\n",
       "      <td>25.00000</td>\n",
       "      <td>6.400000e+01</td>\n",
       "      <td>1.170000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>credit_history</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>100</td>\n",
       "      <td>1.312835e+01</td>\n",
       "      <td>2.112515e+01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>41.00000</td>\n",
       "      <td>9.700000e+01</td>\n",
       "      <td>1.170000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>enquirie_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>23</td>\n",
       "      <td>2.034333e-01</td>\n",
       "      <td>6.965903e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.00000</td>\n",
       "      <td>3.000000e+00</td>\n",
       "      <td>2.800000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>loan_to_asset_ratio</th>\n",
       "      <td>float64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>137938</td>\n",
       "      <td>7.235581e-01</td>\n",
       "      <td>1.136206e-01</td>\n",
       "      <td>1.241298e-01</td>\n",
       "      <td>0.374747</td>\n",
       "      <td>0.566493</td>\n",
       "      <td>0.741398</td>\n",
       "      <td>0.809578</td>\n",
       "      <td>0.85311</td>\n",
       "      <td>8.837075e-01</td>\n",
       "      <td>9.379874e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>total_account_loan_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>103</td>\n",
       "      <td>2.507267e+00</td>\n",
       "      <td>5.273201e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>7.00000</td>\n",
       "      <td>2.400000e+01</td>\n",
       "      <td>3.540000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sub_account_inactive_loan_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>90</td>\n",
       "      <td>1.401633e+00</td>\n",
       "      <td>3.924056e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>4.00000</td>\n",
       "      <td>1.700000e+01</td>\n",
       "      <td>3.440000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>total_inactive_loan_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>27</td>\n",
       "      <td>3.216667e-02</td>\n",
       "      <td>4.291541e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>4.200000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>main_account_inactive_loan_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>91</td>\n",
       "      <td>1.433800e+00</td>\n",
       "      <td>3.964609e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>4.00000</td>\n",
       "      <td>1.700000e+01</td>\n",
       "      <td>3.440000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>total_overdue_no</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>19</td>\n",
       "      <td>1.607200e-01</td>\n",
       "      <td>5.577794e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.00000</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>2.300000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>total_outstanding_loan</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>49406</td>\n",
       "      <td>1.724986e+05</td>\n",
       "      <td>9.969156e+05</td>\n",
       "      <td>-6.678296e+06</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>37888.000000</td>\n",
       "      <td>321915.00000</td>\n",
       "      <td>2.977511e+06</td>\n",
       "      <td>9.652492e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>total_sanction_loan</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>31216</td>\n",
       "      <td>2.299445e+05</td>\n",
       "      <td>2.847267e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>66900.000000</td>\n",
       "      <td>475000.00000</td>\n",
       "      <td>3.545000e+06</td>\n",
       "      <td>1.000000e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>total_disbursed_loan</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>33557</td>\n",
       "      <td>2.294413e+05</td>\n",
       "      <td>2.850957e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>65000.000000</td>\n",
       "      <td>471940.20000</td>\n",
       "      <td>3.536509e+06</td>\n",
       "      <td>1.000000e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>total_monthly_payment</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>21843</td>\n",
       "      <td>1.325285e+04</td>\n",
       "      <td>1.515095e+05</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>2076.000000</td>\n",
       "      <td>11851.00000</td>\n",
       "      <td>2.603580e+05</td>\n",
       "      <td>2.076655e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>outstanding_disburse_ratio</th>\n",
       "      <td>float64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>4391</td>\n",
       "      <td>inf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.100003e+05</td>\n",
       "      <td>0.800000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.260000</td>\n",
       "      <td>2.51000</td>\n",
       "      <td>2.659671e+04</td>\n",
       "      <td>inf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>main_account_tenure</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>12816</td>\n",
       "      <td>5.169842e+04</td>\n",
       "      <td>2.614563e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>25.000000</td>\n",
       "      <td>35000.00000</td>\n",
       "      <td>1.002305e+06</td>\n",
       "      <td>1.000000e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sub_account_tenure</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>1230</td>\n",
       "      <td>2.773138e+03</td>\n",
       "      <td>1.043622e+05</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>9.000000e+01</td>\n",
       "      <td>1.980000e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>disburse_to_sactioned_ratio</th>\n",
       "      <td>float64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>375</td>\n",
       "      <td>6.506428e+02</td>\n",
       "      <td>1.312314e+05</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.620000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.00000</td>\n",
       "      <td>1.020000e+00</td>\n",
       "      <td>5.000000e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>active_to_inactive_act_ratio</th>\n",
       "      <td>float64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>211</td>\n",
       "      <td>1.438740e+00</td>\n",
       "      <td>7.898445e-01</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.670000</td>\n",
       "      <td>2.00000</td>\n",
       "      <td>5.000000e+00</td>\n",
       "      <td>1.800000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>year_of_birth</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>48</td>\n",
       "      <td>1.984868e+03</td>\n",
       "      <td>9.813379e+00</td>\n",
       "      <td>1.950000e+03</td>\n",
       "      <td>1960.000000</td>\n",
       "      <td>1971.000000</td>\n",
       "      <td>1987.000000</td>\n",
       "      <td>1993.000000</td>\n",
       "      <td>1996.00000</td>\n",
       "      <td>1.999000e+03</td>\n",
       "      <td>2.001000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>disbursed_date</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>1</td>\n",
       "      <td>2.019000e+03</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>2.019000e+03</td>\n",
       "      <td>2019.000000</td>\n",
       "      <td>2019.000000</td>\n",
       "      <td>2019.000000</td>\n",
       "      <td>2019.000000</td>\n",
       "      <td>2019.00000</td>\n",
       "      <td>2.019000e+03</td>\n",
       "      <td>2.019000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Credit_level</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>14</td>\n",
       "      <td>3.132360e+00</td>\n",
       "      <td>5.268384e+00</td>\n",
       "      <td>-1.000000e+00</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>8.000000</td>\n",
       "      <td>12.00000</td>\n",
       "      <td>1.300000e+01</td>\n",
       "      <td>1.300000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>employment_type</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>3</td>\n",
       "      <td>4.875067e-01</td>\n",
       "      <td>5.615271e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.00000</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>2.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>age</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>48</td>\n",
       "      <td>3.413210e+01</td>\n",
       "      <td>9.813379e+00</td>\n",
       "      <td>1.800000e+01</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>23.000000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>41.000000</td>\n",
       "      <td>48.00000</td>\n",
       "      <td>5.900000e+01</td>\n",
       "      <td>6.900000e+01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>loan_default</th>\n",
       "      <td>int64</td>\n",
       "      <td>150000</td>\n",
       "      <td>0.00%</td>\n",
       "      <td>2</td>\n",
       "      <td>1.769667e-01</td>\n",
       "      <td>3.816418e-01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.00000</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                  type    size missing  unique  mean_or_top1   std_or_top2   min_or_top3    1%_or_top4   10%_or_top5  50%_or_bottom5  75%_or_bottom4  \\\n",
       "customer_id                      int64  150000   0.00%  150000  9.994437e+04  5.762911e+04  0.000000e+00   1985.990000  20055.900000    99887.500000   149916.500000   \n",
       "main_account_loan_no             int64  150000   0.00%     104  2.447133e+00  5.197172e+00  0.000000e+00      0.000000      0.000000        1.000000        3.000000   \n",
       "main_account_active_loan_no      int64  150000   0.00%      35  1.045500e+00  1.952708e+00  0.000000e+00      0.000000      0.000000        0.000000        1.000000   \n",
       "main_account_overdue_no          int64  150000   0.00%      19  1.534267e-01  5.424963e-01  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "main_account_outstanding_loan    int64  150000   0.00%   48609  1.670825e+05  9.808619e+05 -6.678296e+06      0.000000      0.000000        0.000000    35459.000000   \n",
       "main_account_sanction_loan       int64  150000   0.00%   30564  2.225586e+05  2.840313e+06  0.000000e+00      0.000000      0.000000        0.000000    63600.000000   \n",
       "main_account_disbursed_loan      int64  150000   0.00%   32862  2.221730e+05  2.844075e+06  0.000000e+00      0.000000      0.000000        0.000000    61508.500000   \n",
       "sub_account_loan_no              int64  150000   0.00%      36  6.013333e-02  6.529115e-01  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "sub_account_active_loan_no       int64  150000   0.00%      21  2.796667e-02  3.251849e-01  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "sub_account_overdue_no           int64  150000   0.00%       8  7.293333e-03  1.112365e-01  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "sub_account_outstanding_loan     int64  150000   0.00%    2108  5.416077e+03  1.617336e+05 -5.746470e+05      0.000000      0.000000        0.000000        0.000000   \n",
       "sub_account_sanction_loan        int64  150000   0.00%    1519  7.385876e+03  1.742796e+05  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "sub_account_disbursed_loan       int64  150000   0.00%    1725  7.268286e+03  1.735824e+05  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "disbursed_amount                 int64  150000   0.00%   19235  5.423848e+04  1.283546e+04  1.332000e+04  26529.000000  39554.000000    53703.000000    60220.000000   \n",
       "asset_cost                       int64  150000   0.00%   38902  7.580399e+04  1.879745e+04  3.700000e+04  47109.910000  61328.000000    70925.000000    79130.000000   \n",
       "branch_id                        int64  150000   0.00%      82  2.928638e+01  1.933546e+01  0.000000e+00      0.000000      6.000000       28.000000       45.000000   \n",
       "supplier_id                      int64  150000   0.00%    2888  7.249790e+02  6.257256e+02  0.000000e+00      9.000000     75.000000      544.000000     1091.000000   \n",
       "manufacturer_id                  int64  150000   0.00%      10  2.260600e+00  1.403826e+00  0.000000e+00      0.000000      1.000000        2.000000        2.000000   \n",
       "area_id                          int64  150000   0.00%      22  5.614153e+00  5.513141e+00  0.000000e+00      0.000000      0.000000        4.000000        9.000000   \n",
       "employee_code_id                 int64  150000   0.00%    3241  1.207023e+03  8.124421e+02  0.000000e+00     20.000000    197.000000     1107.000000     1833.000000   \n",
       "mobileno_flag                    int64  150000   0.00%       1  1.000000e+00  0.000000e+00  1.000000e+00      1.000000      1.000000        1.000000        1.000000   \n",
       "idcard_flag                      int64  150000   0.00%       1  1.000000e+00  0.000000e+00  1.000000e+00      1.000000      1.000000        1.000000        1.000000   \n",
       "Driving_flag                     int64  150000   0.00%       2  2.301333e-02  1.499462e-01  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "passport_flag                    int64  150000   0.00%       2  2.153333e-03  4.635419e-02  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "credit_score                     int64  150000   0.00%     570  2.912287e+02  3.392824e+02  0.000000e+00      0.000000      0.000000       14.000000      680.000000   \n",
       "main_account_monthly_payment     int64  150000   0.00%   21499  1.295898e+04  1.508468e+05  0.000000e+00      0.000000      0.000000        0.000000     1989.000000   \n",
       "sub_account_monthly_payment      int64  150000   0.00%    1304  2.938682e+02  1.304782e+04  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "last_six_month_new_loan_no       int64  150000   0.00%      24  3.849000e-01  9.628767e-01  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "last_six_month_defaulted_no      int64  150000   0.00%      14  9.568667e-02  3.823590e-01  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "average_age                      int64  150000   0.00%     100  8.027107e+00  1.383039e+01  0.000000e+00      0.000000      0.000000        0.000000       13.000000   \n",
       "credit_history                   int64  150000   0.00%     100  1.312835e+01  2.112515e+01  0.000000e+00      0.000000      0.000000        0.000000       20.000000   \n",
       "enquirie_no                      int64  150000   0.00%      23  2.034333e-01  6.965903e-01  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "loan_to_asset_ratio            float64  150000   0.00%  137938  7.235581e-01  1.136206e-01  1.241298e-01      0.374747      0.566493        0.741398        0.809578   \n",
       "total_account_loan_no            int64  150000   0.00%     103  2.507267e+00  5.273201e+00  0.000000e+00      0.000000      0.000000        1.000000        3.000000   \n",
       "sub_account_inactive_loan_no     int64  150000   0.00%      90  1.401633e+00  3.924056e+00  0.000000e+00      0.000000      0.000000        0.000000        1.000000   \n",
       "total_inactive_loan_no           int64  150000   0.00%      27  3.216667e-02  4.291541e-01  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "main_account_inactive_loan_no    int64  150000   0.00%      91  1.433800e+00  3.964609e+00  0.000000e+00      0.000000      0.000000        0.000000        1.000000   \n",
       "total_overdue_no                 int64  150000   0.00%      19  1.607200e-01  5.577794e-01  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "total_outstanding_loan           int64  150000   0.00%   49406  1.724986e+05  9.969156e+05 -6.678296e+06      0.000000      0.000000        0.000000    37888.000000   \n",
       "total_sanction_loan              int64  150000   0.00%   31216  2.299445e+05  2.847267e+06  0.000000e+00      0.000000      0.000000        0.000000    66900.000000   \n",
       "total_disbursed_loan             int64  150000   0.00%   33557  2.294413e+05  2.850957e+06  0.000000e+00      0.000000      0.000000        0.000000    65000.000000   \n",
       "total_monthly_payment            int64  150000   0.00%   21843  1.325285e+04  1.515095e+05  0.000000e+00      0.000000      0.000000        0.000000     2076.000000   \n",
       "outstanding_disburse_ratio     float64  150000   0.00%    4391           inf           NaN -1.100003e+05      0.800000      1.000000        1.000000        1.260000   \n",
       "main_account_tenure              int64  150000   0.00%   12816  5.169842e+04  2.614563e+06  0.000000e+00      0.000000      0.000000        0.000000       25.000000   \n",
       "sub_account_tenure               int64  150000   0.00%    1230  2.773138e+03  1.043622e+05  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "disburse_to_sactioned_ratio    float64  150000   0.00%     375  6.506428e+02  1.312314e+05  0.000000e+00      0.620000      1.000000        1.000000        1.000000   \n",
       "active_to_inactive_act_ratio   float64  150000   0.00%     211  1.438740e+00  7.898445e-01  1.000000e+00      1.000000      1.000000        1.000000        1.670000   \n",
       "year_of_birth                    int64  150000   0.00%      48  1.984868e+03  9.813379e+00  1.950000e+03   1960.000000   1971.000000     1987.000000     1993.000000   \n",
       "disbursed_date                   int64  150000   0.00%       1  2.019000e+03  0.000000e+00  2.019000e+03   2019.000000   2019.000000     2019.000000     2019.000000   \n",
       "Credit_level                     int64  150000   0.00%      14  3.132360e+00  5.268384e+00 -1.000000e+00     -1.000000     -1.000000       -1.000000        8.000000   \n",
       "employment_type                  int64  150000   0.00%       3  4.875067e-01  5.615271e-01  0.000000e+00      0.000000      0.000000        0.000000        1.000000   \n",
       "age                              int64  150000   0.00%      48  3.413210e+01  9.813379e+00  1.800000e+01     20.000000     23.000000       32.000000       41.000000   \n",
       "loan_default                     int64  150000   0.00%       2  1.769667e-01  3.816418e-01  0.000000e+00      0.000000      0.000000        0.000000        0.000000   \n",
       "\n",
       "                               90%_or_bottom3  99%_or_bottom2  max_or_bottom1  \n",
       "customer_id                      179763.10000    1.976900e+05    1.997160e+05  \n",
       "main_account_loan_no                  7.00000    2.300000e+01    3.540000e+02  \n",
       "main_account_active_loan_no           3.00000    9.000000e+00    1.440000e+02  \n",
       "main_account_overdue_no               1.00000    2.000000e+00    2.300000e+01  \n",
       "main_account_outstanding_loan    306508.00000    2.901551e+06    9.652492e+07  \n",
       "main_account_sanction_loan       450000.00000    3.458866e+06    1.000000e+09  \n",
       "main_account_disbursed_loan      450000.00000    3.446830e+06    1.000000e+09  \n",
       "sub_account_loan_no                   0.00000    2.000000e+00    5.200000e+01  \n",
       "sub_account_active_loan_no            0.00000    1.000000e+00    3.600000e+01  \n",
       "sub_account_overdue_no                0.00000    0.000000e+00    7.000000e+00  \n",
       "sub_account_outstanding_loan          0.00000    2.048519e+04    3.603285e+07  \n",
       "sub_account_sanction_loan             0.00000    5.000000e+04    2.688820e+07  \n",
       "sub_account_disbursed_loan            0.00000    4.800000e+04    2.688820e+07  \n",
       "disbursed_amount                  68869.00000    9.529000e+04    9.905720e+05  \n",
       "asset_cost                        99077.20000    1.553340e+05    1.628992e+06  \n",
       "branch_id                            55.00000    7.500000e+01    8.100000e+01  \n",
       "supplier_id                        1669.00000    2.483010e+03    2.933000e+03  \n",
       "manufacturer_id                       5.00000    6.000000e+00    9.000000e+00  \n",
       "area_id                              16.00000    1.800000e+01    2.100000e+01  \n",
       "employee_code_id                   2405.00000    2.980000e+03    3.255000e+03  \n",
       "mobileno_flag                         1.00000    1.000000e+00    1.000000e+00  \n",
       "idcard_flag                           1.00000    1.000000e+00    1.000000e+00  \n",
       "Driving_flag                          0.00000    1.000000e+00    1.000000e+00  \n",
       "passport_flag                         0.00000    0.000000e+00    1.000000e+00  \n",
       "credit_score                        762.00000    8.360000e+02    8.900000e+02  \n",
       "main_account_monthly_payment      11458.10000    2.515448e+05    2.076655e+07  \n",
       "sub_account_monthly_payment           0.00000    0.000000e+00    3.246710e+06  \n",
       "last_six_month_new_loan_no            1.00000    4.000000e+00    3.500000e+01  \n",
       "last_six_month_defaulted_no           0.00000    2.000000e+00    2.000000e+01  \n",
       "average_age                          25.00000    6.400000e+01    1.170000e+02  \n",
       "credit_history                       41.00000    9.700000e+01    1.170000e+02  \n",
       "enquirie_no                           1.00000    3.000000e+00    2.800000e+01  \n",
       "loan_to_asset_ratio                   0.85311    8.837075e-01    9.379874e-01  \n",
       "total_account_loan_no                 7.00000    2.400000e+01    3.540000e+02  \n",
       "sub_account_inactive_loan_no          4.00000    1.700000e+01    3.440000e+02  \n",
       "total_inactive_loan_no                0.00000    1.000000e+00    4.200000e+01  \n",
       "main_account_inactive_loan_no         4.00000    1.700000e+01    3.440000e+02  \n",
       "total_overdue_no                      1.00000    2.000000e+00    2.300000e+01  \n",
       "total_outstanding_loan           321915.00000    2.977511e+06    9.652492e+07  \n",
       "total_sanction_loan              475000.00000    3.545000e+06    1.000000e+09  \n",
       "total_disbursed_loan             471940.20000    3.536509e+06    1.000000e+09  \n",
       "total_monthly_payment             11851.00000    2.603580e+05    2.076655e+07  \n",
       "outstanding_disburse_ratio            2.51000    2.659671e+04             inf  \n",
       "main_account_tenure               35000.00000    1.002305e+06    1.000000e+09  \n",
       "sub_account_tenure                    0.00000    9.000000e+01    1.980000e+07  \n",
       "disburse_to_sactioned_ratio           1.00000    1.020000e+00    5.000000e+07  \n",
       "active_to_inactive_act_ratio          2.00000    5.000000e+00    1.800000e+01  \n",
       "year_of_birth                      1996.00000    1.999000e+03    2.001000e+03  \n",
       "disbursed_date                     2019.00000    2.019000e+03    2.019000e+03  \n",
       "Credit_level                         12.00000    1.300000e+01    1.300000e+01  \n",
       "employment_type                       1.00000    2.000000e+00    2.000000e+00  \n",
       "age                                  48.00000    5.900000e+01    6.900000e+01  \n",
       "loan_default                          1.00000    1.000000e+00    1.000000e+00  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "detect(train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=4 fonc=\"仿宋\" color=blue>四、数据预处理</font>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=3 fonc=\"仿宋\" color=green>（一）删除特征</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T12:07:58.302812Z",
     "start_time": "2021-07-16T12:07:58.249809Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 47 ms\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "drop_feature = ['mobileno_flag','idcard_flag', 'disbursed_date']\n",
    "train.drop(drop_feature, axis=1, inplace=True)\n",
    "test.drop(drop_feature, axis=1, inplace=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=3 fonc=\"仿宋\" color=green>（二）类别特征独热编码</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T12:08:00.254923Z",
     "start_time": "2021-07-16T12:07:59.842900Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 404 ms\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "def onehot_model(train):\n",
    "    one_hot = OneHotEncoder(handle_unknown='ignore').fit(train)  # 定义独热编码模型\n",
    "    feature_names = one_hot.get_feature_names(train.columns)  # 将独热编码模型训练后的特征名取出\n",
    "    return one_hot, feature_names\n",
    "\n",
    "def pred_onehot(model, feature_names, pred_dataframe):\n",
    "    return pd.DataFrame(model.transform(pred_dataframe).toarray(),columns=feature_names)\n",
    "\n",
    "columns = ['manufacturer_id', 'area_id', 'Driving_flag', 'passport_flag', 'employment_type']\n",
    "train_categoris = train[columns]\n",
    "test_categoris = test[columns]\n",
    "label = train.pop('loan_default')\n",
    "\n",
    "train.drop(columns, axis=1, inplace=True)\n",
    "test.drop(columns, axis=1, inplace=True)\n",
    "\n",
    "one_hot, feature_names = onehot_model(train_categoris.astype(object))\n",
    "train_onehot = pred_onehot(one_hot, feature_names, train_categoris.astype(object))\n",
    "test_onehot = pred_onehot(one_hot, feature_names, test_categoris.astype(object))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=3 fonc=\"仿宋\" color=green>（三）异常值处理</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T12:08:09.948478Z",
     "start_time": "2021-07-16T12:08:08.037368Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 1.9 s\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "def ourlier_test(df):\n",
    "    columns = ['main_account_overdue_no', 'sub_account_loan_no', 'sub_account_active_loan_no',\n",
    "               'sub_account_overdue_no', 'sub_account_outstanding_loan', 'sub_account_sanction_loan',\n",
    "               'sub_account_disbursed_loan', 'sub_account_monthly_payment', 'last_six_month_new_loan_no',\n",
    "               'last_six_month_defaulted_no', 'enquirie_no', 'total_inactive_loan_no', \n",
    "               'total_overdue_no', 'sub_account_tenure']\n",
    "    for column in df.columns.tolist()[1:]:\n",
    "        if column in columns:\n",
    "            pass\n",
    "        else:\n",
    "            describe = df[column].describe()\n",
    "            up = describe.loc['75%']\n",
    "            down = describe.loc['25%']\n",
    "            upper = up + 1.5 * (up - down)\n",
    "            lower = down - 1.5 * (up - down)\n",
    "            df.loc[df[column] > upper, column] = upper\n",
    "            df.loc[df[column] < lower, column] = lower\n",
    "    \n",
    "    return df\n",
    "\n",
    "train = ourlier_test(train)\n",
    "test = ourlier_test(test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=3 fonc=\"仿宋\" color=green>（四）特征衍生</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T12:08:16.086829Z",
     "start_time": "2021-07-16T12:08:15.813813Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 268 ms\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "columns = ['year_of_birth', 'branch_id', 'supplier_id', 'employee_code_id', 'credit_history']\n",
    "for column in columns:\n",
    "    group = train.groupby(by=column)[column].count().to_dict()\n",
    "    train[column] = train[column].map(group)\n",
    "    test[column] = test[column].map(group)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=3 fonc=\"仿宋\" color=green>（四）特征合并</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T12:08:20.399075Z",
     "start_time": "2021-07-16T12:08:20.210065Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 184 ms\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "train = train.join(train_onehot)\n",
    "train.index = range(len(train))\n",
    "\n",
    "test = test.join(train_onehot)\n",
    "test.index = range(len(test))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=5 color=blue fonc=\"仿宋\">五、建模</font>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=3 fonc=\"仿宋\" color=green>（一）划分变量与目标</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T12:08:23.291241Z",
     "start_time": "2021-07-16T12:08:23.218237Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 69 ms\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "feature = train.iloc[:, 1:]\n",
    "\n",
    "uid = test.customer_id\n",
    "pred_feature = test.iloc[:, 1:]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=3 fonc=\"仿宋\" color=green>（二）划分训练集与测试集</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T12:08:25.815385Z",
     "start_time": "2021-07-16T12:08:25.450364Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 359 ms\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "x_train, x_test, y_train, y_test = train_test_split(feature, label, \n",
    "                                                    test_size=0.4, \n",
    "                                                    random_state=2021)\n",
    "x_valid, x_test, y_valid, y_test = train_test_split(x_test, y_test, \n",
    "                                                    test_size=0.5, \n",
    "                                                    random_state=2021)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=3 fonc=\"仿宋\" color=green>（三）baseline版本</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T11:53:45.255020Z",
     "start_time": "2021-07-16T11:53:39.848711Z"
    },
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\tvalidation_0-logloss:0.64219\tvalidation_0-auc:0.63328\tvalidation_1-logloss:0.64359\tvalidation_1-auc:0.61661\n",
      "Multiple eval metrics have been passed: 'validation_1-auc' will be used for early stopping.\n",
      "\n",
      "Will train until validation_1-auc hasn't improved in 10 rounds.\n",
      "[1]\tvalidation_0-logloss:0.60996\tvalidation_0-auc:0.64870\tvalidation_1-logloss:0.61281\tvalidation_1-auc:0.62728\n",
      "[2]\tvalidation_0-logloss:0.58859\tvalidation_0-auc:0.65665\tvalidation_1-logloss:0.59293\tvalidation_1-auc:0.63065\n",
      "[3]\tvalidation_0-logloss:0.57337\tvalidation_0-auc:0.66485\tvalidation_1-logloss:0.57924\tvalidation_1-auc:0.63509\n",
      "[4]\tvalidation_0-logloss:0.56261\tvalidation_0-auc:0.67060\tvalidation_1-logloss:0.56959\tvalidation_1-auc:0.63870\n",
      "[5]\tvalidation_0-logloss:0.55441\tvalidation_0-auc:0.67582\tvalidation_1-logloss:0.56248\tvalidation_1-auc:0.64234\n",
      "[6]\tvalidation_0-logloss:0.54867\tvalidation_0-auc:0.67867\tvalidation_1-logloss:0.55766\tvalidation_1-auc:0.64401\n",
      "[7]\tvalidation_0-logloss:0.54383\tvalidation_0-auc:0.68328\tvalidation_1-logloss:0.55402\tvalidation_1-auc:0.64608\n",
      "[8]\tvalidation_0-logloss:0.54000\tvalidation_0-auc:0.68763\tvalidation_1-logloss:0.55104\tvalidation_1-auc:0.64796\n",
      "[9]\tvalidation_0-logloss:0.53682\tvalidation_0-auc:0.69126\tvalidation_1-logloss:0.54923\tvalidation_1-auc:0.64785\n",
      "[10]\tvalidation_0-logloss:0.53451\tvalidation_0-auc:0.69324\tvalidation_1-logloss:0.54824\tvalidation_1-auc:0.64699\n",
      "[11]\tvalidation_0-logloss:0.53230\tvalidation_0-auc:0.69655\tvalidation_1-logloss:0.54711\tvalidation_1-auc:0.64730\n",
      "[12]\tvalidation_0-logloss:0.53019\tvalidation_0-auc:0.69978\tvalidation_1-logloss:0.54618\tvalidation_1-auc:0.64794\n",
      "[13]\tvalidation_0-logloss:0.52865\tvalidation_0-auc:0.70234\tvalidation_1-logloss:0.54541\tvalidation_1-auc:0.64885\n",
      "[14]\tvalidation_0-logloss:0.52700\tvalidation_0-auc:0.70528\tvalidation_1-logloss:0.54495\tvalidation_1-auc:0.64863\n",
      "[15]\tvalidation_0-logloss:0.52589\tvalidation_0-auc:0.70697\tvalidation_1-logloss:0.54466\tvalidation_1-auc:0.64869\n",
      "[16]\tvalidation_0-logloss:0.52387\tvalidation_0-auc:0.71109\tvalidation_1-logloss:0.54361\tvalidation_1-auc:0.65074\n",
      "[17]\tvalidation_0-logloss:0.52214\tvalidation_0-auc:0.71446\tvalidation_1-logloss:0.54294\tvalidation_1-auc:0.65158\n",
      "[18]\tvalidation_0-logloss:0.52090\tvalidation_0-auc:0.71694\tvalidation_1-logloss:0.54253\tvalidation_1-auc:0.65165\n",
      "[19]\tvalidation_0-logloss:0.51988\tvalidation_0-auc:0.71894\tvalidation_1-logloss:0.54209\tvalidation_1-auc:0.65212\n",
      "[20]\tvalidation_0-logloss:0.51926\tvalidation_0-auc:0.71980\tvalidation_1-logloss:0.54180\tvalidation_1-auc:0.65254\n",
      "[21]\tvalidation_0-logloss:0.51851\tvalidation_0-auc:0.72125\tvalidation_1-logloss:0.54164\tvalidation_1-auc:0.65242\n",
      "[22]\tvalidation_0-logloss:0.51745\tvalidation_0-auc:0.72348\tvalidation_1-logloss:0.54138\tvalidation_1-auc:0.65243\n",
      "[23]\tvalidation_0-logloss:0.51673\tvalidation_0-auc:0.72476\tvalidation_1-logloss:0.54132\tvalidation_1-auc:0.65173\n",
      "[24]\tvalidation_0-logloss:0.51565\tvalidation_0-auc:0.72696\tvalidation_1-logloss:0.54096\tvalidation_1-auc:0.65223\n",
      "[25]\tvalidation_0-logloss:0.51524\tvalidation_0-auc:0.72744\tvalidation_1-logloss:0.54100\tvalidation_1-auc:0.65202\n",
      "[26]\tvalidation_0-logloss:0.51477\tvalidation_0-auc:0.72821\tvalidation_1-logloss:0.54086\tvalidation_1-auc:0.65184\n",
      "[27]\tvalidation_0-logloss:0.51395\tvalidation_0-auc:0.72976\tvalidation_1-logloss:0.54067\tvalidation_1-auc:0.65204\n",
      "[28]\tvalidation_0-logloss:0.51291\tvalidation_0-auc:0.73178\tvalidation_1-logloss:0.54049\tvalidation_1-auc:0.65227\n",
      "[29]\tvalidation_0-logloss:0.51201\tvalidation_0-auc:0.73346\tvalidation_1-logloss:0.54036\tvalidation_1-auc:0.65212\n",
      "[30]\tvalidation_0-logloss:0.51102\tvalidation_0-auc:0.73565\tvalidation_1-logloss:0.54033\tvalidation_1-auc:0.65196\n",
      "Stopping. Best iteration:\n",
      "[20]\tvalidation_0-logloss:0.51926\tvalidation_0-auc:0.71980\tvalidation_1-logloss:0.54180\tvalidation_1-auc:0.65254\n",
      "\n",
      "Wall time: 5.39 s\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "XGBClassifier(base_score=0.5, booster='gbtree', colsample_bylevel=1,\n",
       "              colsample_bynode=1, colsample_bytree=1, gamma=0, gpu_id=-1,\n",
       "              importance_type='gain', interaction_constraints='',\n",
       "              learning_rate=0.300000012, max_delta_step=0, max_depth=6,\n",
       "              min_child_weight=1, missing=nan, monotone_constraints='()',\n",
       "              n_estimators=100, n_jobs=0, num_parallel_tree=1, random_state=0,\n",
       "              reg_alpha=0, reg_lambda=1, scale_pos_weight=3, subsample=1,\n",
       "              tree_method='exact', validate_parameters=1, verbosity=None)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%%time\n",
    "model = XGBClassifier(scale_pos_weight=3)\n",
    "model.fit(x_train, y_train, \n",
    "          early_stopping_rounds=10, \n",
    "          eval_metric=[\"logloss\", \"auc\"], \n",
    "          eval_set=[(x_train, y_train), (x_valid, y_valid)], \n",
    "          verbose=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=3 fonc=\"仿宋\" color=green>（四）baseline评估</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T11:53:52.466433Z",
     "start_time": "2021-07-16T11:53:49.696274Z"
    },
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.3 模型得分： 0.42603607824790307\n",
      "0.31 模型得分： 0.43746277045022214\n",
      "0.32 模型得分： 0.4501625877723121\n",
      "0.33 模型得分： 0.46282455719955395\n",
      "0.34 模型得分： 0.47388572568209375\n",
      "0.35000000000000003 模型得分： 0.48510710434913457\n",
      "0.36000000000000004 模型得分： 0.49621386889874974\n",
      "0.37000000000000005 模型得分： 0.5081635883943464\n",
      "0.38000000000000006 模型得分： 0.5181670258450184\n",
      "0.39000000000000007 模型得分： 0.5279555729455835\n",
      "0.4000000000000001 模型得分： 0.5379306710926669\n",
      "0.4100000000000001 模型得分： 0.5464984813831724\n",
      "0.4200000000000001 模型得分： 0.5541401249039578\n",
      "0.4300000000000001 模型得分： 0.5607807670223948\n",
      "0.4400000000000001 模型得分： 0.5667887016110292\n",
      "0.4500000000000001 模型得分： 0.5733966883201979\n",
      "0.46000000000000013 模型得分： 0.5773786884350627\n",
      "0.47000000000000014 模型得分： 0.5792574047204652\n",
      "0.48000000000000015 模型得分： 0.5806081212441195\n",
      "0.49000000000000016 模型得分： 0.5776051138394889\n",
      "0.5000000000000001 模型得分： 0.573582634126837\n",
      "0.5100000000000001 模型得分： 0.5706569846506107\n",
      "0.5200000000000001 模型得分： 0.565238803227067\n",
      "0.5300000000000001 模型得分： 0.5596582863585626\n",
      "0.5400000000000001 模型得分： 0.553157871013637\n",
      "0.5500000000000002 模型得分： 0.5468192500156297\n",
      "0.5600000000000002 模型得分： 0.5390425059686964\n",
      "0.5700000000000002 模型得分： 0.5307023199497631\n",
      "0.5800000000000002 模型得分： 0.5241167288788141\n",
      "0.5900000000000002 模型得分： 0.5159485343846117\n",
      "0.6000000000000002 模型得分： 0.5094764088506621\n",
      "0.6100000000000002 模型得分： 0.5012398073846736\n",
      "0.6200000000000002 模型得分： 0.4965822058150202\n",
      "0.6300000000000002 模型得分： 0.49116099775288147\n",
      "0.6400000000000002 模型得分： 0.48658949872236607\n",
      "0.6500000000000002 模型得分： 0.48151792989678577\n",
      "0.6600000000000003 模型得分： 0.4782333826619486\n",
      "0.6700000000000003 模型得分： 0.4744302771459974\n",
      "0.6800000000000003 模型得分： 0.47047007345998926\n",
      "0.6900000000000003 模型得分： 0.4651813734450158\n",
      "0.7000000000000003 模型得分： 0.4605388740028583\n",
      "0.7100000000000003 模型得分： 0.4580449995945761\n",
      "0.7200000000000003 模型得分： 0.45668296444189616\n",
      "0.7300000000000003 模型得分： 0.4548763002547077\n",
      "0.7400000000000003 模型得分： 0.4539988482303456\n",
      "0.7500000000000003 模型得分： 0.4536506823859788\n",
      "0.7600000000000003 模型得分： 0.45307509701502796\n",
      "0.7700000000000004 模型得分： 0.4529208752211386\n",
      "0.7800000000000004 模型得分： 0.4527560182547126\n",
      "0.7900000000000004 模型得分： 0.4521885346536342\n",
      "0.8000000000000004 模型得分： 0.4522088809291239\n",
      "0.8100000000000004 模型得分： 0.4520227926452286\n",
      "0.8200000000000004 模型得分： 0.4518365627944965\n",
      "0.8300000000000004 模型得分： 0.45165019121715616\n",
      "0.8400000000000004 模型得分： 0.45165019121715616\n",
      "0.8500000000000004 模型得分： 0.45165019121715616\n",
      "0.8600000000000004 模型得分： 0.45165019121715616\n",
      "0.8700000000000004 模型得分： 0.45165019121715616\n",
      "0.8800000000000004 模型得分： 0.45165019121715616\n",
      "0.8900000000000005 模型得分： 0.45165019121715616\n",
      "0.9000000000000005 模型得分： 0.45165019121715616\n",
      "0.9100000000000005 模型得分： 0.4514536478332419\n",
      "0.9200000000000005 模型得分： 0.4514536478332419\n",
      "0.9300000000000005 模型得分： 0.4514536478332419\n",
      "0.9400000000000005 模型得分： 0.4514536478332419\n",
      "0.9500000000000005 模型得分： 0.4514536478332419\n",
      "0.9600000000000005 模型得分： 0.4514536478332419\n",
      "0.9700000000000005 模型得分： 0.4514536478332419\n",
      "0.9800000000000005 模型得分： 0.4514536478332419\n",
      "0.9900000000000005 模型得分： 0.4514536478332419\n"
     ]
    }
   ],
   "source": [
    "pred = model.predict_proba(x_test)[:,1]\n",
    "rate = 0.3\n",
    "while rate < 1:\n",
    "    rate_tran = []\n",
    "    for i in pred.tolist():\n",
    "        if i < rate:\n",
    "            rate_tran.append(0)\n",
    "        else:\n",
    "            rate_tran.append(1)\n",
    "    print(rate, \"模型得分：\", f1_score(y_test.values, rate_tran, average=\"macro\"))\n",
    "    rate += 0.01"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T11:41:20.284410Z",
     "start_time": "2021-07-16T11:41:20.023395Z"
    }
   },
   "outputs": [],
   "source": [
    "# test['loan_default'] = pd.Series(model.predict_proba(pred_feature)[:, 1]).apply(lambda x: 1 if x >= 0.48 else 0)\n",
    "# test[['customer_id', 'loan_default']].to_csv('result.csv', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T12:09:19.309445Z",
     "start_time": "2021-07-16T12:09:19.301444Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "XGBClassifier(base_score=None, booster=None, colsample_bylevel=None,\n",
       "              colsample_bynode=None, colsample_bytree=None, gamma=None,\n",
       "              gpu_id=None, importance_type='gain', interaction_constraints=None,\n",
       "              learning_rate=None, max_delta_step=None, max_depth=None,\n",
       "              min_child_weight=None, missing=nan, monotone_constraints=None,\n",
       "              n_estimators=100, n_jobs=None, num_parallel_tree=None,\n",
       "              random_state=None, reg_alpha=None, reg_lambda=None,\n",
       "              scale_pos_weight=None, subsample=None, tree_method=None,\n",
       "              validate_parameters=None, verbosity=None)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "XGBClassifier()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=5 fonc=\"仿宋\" color=blue>六、调参</font>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=3 fonc='仿宋' color=red>learning_rate=1.6</font>  \n",
    "<font size=3 fonc='仿宋' color=red>base_score=0.5</font>  \n",
    "<font size=3 fonc='仿宋' color=red>scale_pos_weight=3</font>  \n",
    "<font size=3 fonc='仿宋' color=red>n_estimators=7</font>  \n",
    "<font size=3 fonc='仿宋' color=red>n_estimators=7</font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-07-16T17:02:56.759105Z",
     "start_time": "2021-07-16T15:56:07.565793Z"
    },
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "最优：0.5601857609125698 使用{'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.552173 (0.005427) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.553160 (0.005138) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.556046 (0.006816) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.555452 (0.005584) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.553156 (0.005672) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.553250 (0.005196) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.555094 (0.006128) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.555524 (0.005633) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.553323 (0.006056) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.553871 (0.007370) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.554809 (0.005739) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.554712 (0.006388) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.552389 (0.006116) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.552701 (0.007008) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.555962 (0.005753) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.555389 (0.004541) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.549718 (0.008953) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.555127 (0.005841) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.555691 (0.006204) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.559340 (0.006595) with {'colsample_bytree': 0.6, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.553418 (0.005319) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.553198 (0.005223) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.555395 (0.006518) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.555294 (0.005718) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.553447 (0.005197) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.552981 (0.005245) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.555045 (0.006646) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.555548 (0.005706) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.552706 (0.005384) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.553835 (0.007803) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.554745 (0.005818) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.554675 (0.006370) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.553246 (0.007035) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.553108 (0.006781) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.555888 (0.005715) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.556561 (0.005914) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.549102 (0.007972) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.555140 (0.005808) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.556238 (0.006512) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.560186 (0.006416) with {'colsample_bytree': 0.6, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.552442 (0.005615) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.551885 (0.007413) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.554862 (0.005733) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.554606 (0.004929) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.552992 (0.005169) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.551940 (0.007347) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.554836 (0.005699) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.554662 (0.004996) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.551173 (0.006507) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.551882 (0.004362) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.555965 (0.004917) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.556358 (0.007351) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.551764 (0.006605) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.555236 (0.006329) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.556209 (0.005766) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.559447 (0.006206) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.553606 (0.008158) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.554713 (0.008198) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.559037 (0.004106) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.559217 (0.007646) with {'colsample_bytree': 0.6, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.553997 (0.007284) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.552904 (0.006695) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.556815 (0.006133) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.557603 (0.006753) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.554433 (0.007905) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.555005 (0.007713) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.556174 (0.004361) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.558644 (0.006716) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.553979 (0.007402) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.555146 (0.007331) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.555328 (0.004251) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.560110 (0.005958) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.553763 (0.005475) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.553894 (0.006607) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.558116 (0.003137) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.558683 (0.007254) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.554758 (0.005225) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.555482 (0.005635) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.556772 (0.003590) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.559074 (0.006243) with {'colsample_bytree': 0.6, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.552431 (0.006066) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.555215 (0.008098) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.555501 (0.005306) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.559567 (0.006790) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.552480 (0.006026) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.554110 (0.006974) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.556652 (0.006013) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.559393 (0.007031) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.555043 (0.005398) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.552228 (0.008991) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.558381 (0.001933) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.557615 (0.007644) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.553152 (0.007563) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.552451 (0.006821) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.557334 (0.003379) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.558528 (0.005873) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.550827 (0.006219) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.551445 (0.006176) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.556266 (0.006152) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.559342 (0.006363) with {'colsample_bytree': 0.6, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.555130 (0.008284) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.556792 (0.007033) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.554507 (0.006304) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.553803 (0.006173) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.555872 (0.007871) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.556897 (0.007303) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.554355 (0.006202) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.553538 (0.005956) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.552182 (0.006982) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.553807 (0.007404) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.555814 (0.008250) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.555446 (0.004851) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.553833 (0.006182) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.554292 (0.008003) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.553944 (0.007499) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.555573 (0.006162) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.552133 (0.006325) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.553165 (0.007296) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.558491 (0.006928) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.554467 (0.004123) with {'colsample_bytree': 0.7, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.555851 (0.007885) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.555268 (0.008190) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.554417 (0.006354) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.553473 (0.005949) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.555464 (0.007916) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.556431 (0.007738) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.554477 (0.006159) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.553471 (0.005950) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.551725 (0.008235) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.554363 (0.008282) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.555839 (0.008280) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.554648 (0.005595) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.554021 (0.006325) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.553897 (0.008301) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.553993 (0.007507) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.555546 (0.006106) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.551882 (0.005963) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.553600 (0.007408) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.558617 (0.006884) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.554397 (0.004225) with {'colsample_bytree': 0.7, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.551065 (0.007796) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.555053 (0.008394) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.554696 (0.007790) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.556051 (0.005205) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.551023 (0.007798) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.555227 (0.008390) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.554679 (0.007813) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.556078 (0.005208) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.552363 (0.007789) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.554551 (0.008569) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.554673 (0.007235) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.555175 (0.006528) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.553225 (0.005783) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.552950 (0.008148) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.558656 (0.005744) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.554661 (0.004967) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.554283 (0.006821) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.552553 (0.009361) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.556583 (0.006868) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.554519 (0.005520) with {'colsample_bytree': 0.7, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.551931 (0.006434) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.552464 (0.009012) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.554159 (0.008143) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.554701 (0.008090) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.552203 (0.006936) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.552632 (0.008930) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.553972 (0.007971) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.554258 (0.007373) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.553299 (0.008082) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.553075 (0.008388) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.555640 (0.006781) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.555823 (0.003889) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.555192 (0.006804) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.553140 (0.009341) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.555801 (0.005996) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.556138 (0.006270) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.555481 (0.006588) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.552504 (0.008507) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.555893 (0.004858) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.555040 (0.006881) with {'colsample_bytree': 0.7, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.555734 (0.007128) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.553081 (0.008400) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.555941 (0.006606) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.556654 (0.004079) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.556751 (0.006274) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.552071 (0.007325) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.554810 (0.007155) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.556600 (0.004068) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.553405 (0.007349) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.554595 (0.006720) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.556460 (0.006972) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.556629 (0.006497) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.554635 (0.007301) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.552917 (0.007394) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.556715 (0.005016) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.555774 (0.006528) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.552966 (0.006786) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.555818 (0.007392) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.556035 (0.005915) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.556708 (0.006948) with {'colsample_bytree': 0.7, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.554876 (0.004917) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.556634 (0.008179) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.557471 (0.005221) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.555179 (0.005051) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.554865 (0.005287) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.556420 (0.006893) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.557576 (0.005136) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.555278 (0.004933) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.553042 (0.008174) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.553860 (0.006879) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.555396 (0.006634) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.556816 (0.005797) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.551737 (0.006515) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.553177 (0.007212) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.558047 (0.005844) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.556052 (0.005529) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.551380 (0.006213) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.553473 (0.009507) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.557065 (0.006256) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.556831 (0.006049) with {'colsample_bytree': 0.8, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.554805 (0.006334) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.555569 (0.007492) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.557585 (0.005141) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.555978 (0.004531) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.556055 (0.006816) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.555473 (0.007604) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.557076 (0.005755) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.556016 (0.004519) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.553778 (0.006815) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.553835 (0.006842) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.555432 (0.006479) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.555371 (0.006588) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.551973 (0.006321) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.554661 (0.006425) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.558131 (0.005816) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.556119 (0.005553) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.551530 (0.005963) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.552646 (0.008697) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.556984 (0.006038) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.555975 (0.006612) with {'colsample_bytree': 0.8, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.552380 (0.005126) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.553953 (0.008691) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.554972 (0.005626) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.557411 (0.005566) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.551925 (0.004966) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.554007 (0.008613) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.555176 (0.005475) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.557264 (0.005642) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.552328 (0.007117) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.552248 (0.007397) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.557239 (0.005255) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.556643 (0.006717) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.553847 (0.005381) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.553359 (0.008075) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.556109 (0.004880) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.556583 (0.006807) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.553797 (0.005842) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.554690 (0.007741) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.556560 (0.006487) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.556883 (0.005159) with {'colsample_bytree': 0.8, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.552940 (0.007134) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.554645 (0.007402) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.554603 (0.007049) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.554584 (0.007218) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.552485 (0.007006) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.554609 (0.007414) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.554376 (0.007109) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.555039 (0.007657) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.553071 (0.006340) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.551162 (0.008235) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.552623 (0.006286) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.555769 (0.006994) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.553892 (0.006015) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.553042 (0.009007) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.556545 (0.006059) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.555031 (0.005312) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.556056 (0.006728) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.554059 (0.007444) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.555567 (0.006762) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.558043 (0.004231) with {'colsample_bytree': 0.8, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.555646 (0.006306) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.554205 (0.006835) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.557956 (0.004676) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.556206 (0.005095) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.556586 (0.006631) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.553918 (0.006495) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.557344 (0.004847) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.556032 (0.005129) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.554587 (0.008057) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.554045 (0.007455) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.557693 (0.005203) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.557287 (0.005077) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.554650 (0.007644) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.554048 (0.005330) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.557120 (0.005697) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.556034 (0.005640) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.552621 (0.005883) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.554477 (0.005563) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.554017 (0.004987) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.557280 (0.005201) with {'colsample_bytree': 0.8, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.554221 (0.008515) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.554671 (0.005358) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.555069 (0.005930) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.554992 (0.006701) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.554798 (0.008510) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.554068 (0.005613) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.556081 (0.006956) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.554978 (0.006698) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.552510 (0.006056) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.556370 (0.007978) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.554981 (0.007305) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.554160 (0.006918) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.552649 (0.004994) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.554037 (0.005978) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.558007 (0.007016) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.554611 (0.005392) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.554091 (0.006977) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.555634 (0.008361) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.555827 (0.005797) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.556150 (0.007185) with {'colsample_bytree': 0.9, 'reg_alpha': 0.05, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.554812 (0.008884) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.554215 (0.005692) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.556089 (0.006956) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.555431 (0.007155) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.552969 (0.008224) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.553698 (0.006012) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.555959 (0.006706) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.555236 (0.006722) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.552611 (0.006360) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.556371 (0.008045) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.554531 (0.007628) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.554122 (0.006362) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.552729 (0.005012) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.554336 (0.006025) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.557986 (0.007106) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.555015 (0.005346) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.553478 (0.006379) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.555782 (0.007566) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.555857 (0.005870) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.556505 (0.007234) with {'colsample_bytree': 0.9, 'reg_alpha': 0.1, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.550964 (0.004713) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.556383 (0.008156) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.555106 (0.007044) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.555915 (0.005521) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.552861 (0.005188) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.556350 (0.008217) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.554996 (0.007129) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.555281 (0.006782) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.552867 (0.007331) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.555216 (0.007074) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.555298 (0.006800) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.556339 (0.007226) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.552508 (0.004639) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.555029 (0.008753) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.556051 (0.006438) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.556851 (0.006901) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.551493 (0.006260) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.554688 (0.009886) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.557958 (0.006497) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.556746 (0.006227) with {'colsample_bytree': 0.9, 'reg_alpha': 1, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.555728 (0.005646) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.553515 (0.008460) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.555355 (0.007805) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.555115 (0.004113) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.554726 (0.005516) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.553811 (0.008375) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.555380 (0.007825) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.555553 (0.004353) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.553729 (0.004720) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.554288 (0.007814) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.556460 (0.006158) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.555489 (0.006810) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.550210 (0.005983) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.556196 (0.009289) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.557807 (0.006319) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.556815 (0.007539) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.551004 (0.006862) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.556105 (0.007666) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.555772 (0.003333) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.557199 (0.006907) with {'colsample_bytree': 0.9, 'reg_alpha': 2, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "0.552582 (0.008553) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.6}\n",
      "0.554220 (0.009497) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.7}\n",
      "0.555050 (0.005293) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.8}\n",
      "0.556495 (0.007540) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 0.05, 'subsample': 0.9}\n",
      "0.551966 (0.008236) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.6}\n",
      "0.553105 (0.009626) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.7}\n",
      "0.555143 (0.005255) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.8}\n",
      "0.556499 (0.007563) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 0.1, 'subsample': 0.9}\n",
      "0.552454 (0.008408) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.6}\n",
      "0.554968 (0.009191) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.7}\n",
      "0.556280 (0.006497) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.8}\n",
      "0.556372 (0.006262) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 1, 'subsample': 0.9}\n",
      "0.553654 (0.006635) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.6}\n",
      "0.554828 (0.006622) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.7}\n",
      "0.555281 (0.005054) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.8}\n",
      "0.557275 (0.005706) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 2, 'subsample': 0.9}\n",
      "0.551923 (0.006070) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.6}\n",
      "0.552915 (0.008585) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.7}\n",
      "0.558753 (0.005894) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.8}\n",
      "0.556132 (0.005276) with {'colsample_bytree': 0.9, 'reg_alpha': 3, 'reg_lambda': 3, 'subsample': 0.9}\n",
      "Wall time: 1h 6min 49s\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "param_grid = {'subsample': [0.6, 0.7, 0.8, 0.9],\n",
    "              'colsample_bytree': [0.6, 0.7, 0.8, 0.9],\n",
    "              'reg_alpha': [0.05, 0.1, 1, 2, 3],\n",
    "              'reg_lambda': [0.05, 0.1, 1, 2, 3]}\n",
    "model = XGBClassifier(learning_rate=1.6, \n",
    "                      scale_pos_weight=3,\n",
    "                      n_estimators=7, \n",
    "                      max_depth=4, \n",
    "                      min_child_weight=4,\n",
    "                      gamma=0.01, \n",
    "                      colsample_bytree=0.6, \n",
    "                      reg_alpha=0.1,\n",
    "                      reg_lambda=3,\n",
    "                      subsample=0.9)\n",
    "kfold = KFold(n_splits=10, random_state=2021)\n",
    "grid = GridSearchCV(estimator=model, param_grid=param_grid, scoring='f1_macro', cv=kfold)\n",
    "grid_result = grid.fit(X=x_train, y=y_train)\n",
    "\n",
    "print('最优：%s 使用%s' % (grid_result.best_score_, grid_result.best_params_))\n",
    "cv_results = zip(grid_result.cv_results_['mean_test_score'], \n",
    "                 grid_result.cv_results_['std_test_score'], \n",
    "                 grid_result.cv_results_['params'])\n",
    "for mean, std, param in cv_results:\n",
    "    print('%f (%f) with %r' % (mean, std, param))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "'base_score': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],   \n",
    "'n_estimators': [3,5,10,20,30,40,50,60,70],   \n",
    "'max_depth': [i for i in range(3, 11, 1)],   \n",
    "'min_child_weight': [i for i in range(3, 21, 1)],   \n",
    "'gamma': [i/100 for i in range(1, 101, 1)],   \n",
    "'subsample': [0.6, 0.7, 0.8, 0.9],   \n",
    "'colsample_bytree': [0.6, 0.7, 0.8, 0.9],   \n",
    "'reg_alpha': [0.05, 0.1, 1, 2, 3],   \n",
    "'reg_lambda': [0.05, 0.1, 1, 2, 3],   \n",
    "'scale_pos_weight': [1,2,3,4,5,6,7,8,9,10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:lkm]",
   "language": "python",
   "name": "lkm"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
